/**
 * FileName: ClassLoadClinit
 * Author:   powersi
 * Date:     2021/3/10 21:52
 * Description:
 */
package com.zm.demo.core.jvm;

/**
 * Description: 
 * Author:      powersi
 * Date:        2021/3/10 21:52
 */
public class ClassLoadClinit1 {

    public static Integer integer = 10;
    static {
        new Thread(()->{
            synchronized (ClassLoadClinit1.class){
                System.out.println("static sync");
                try {
                    Thread.sleep(100L);
                } catch (Exception e){
                    e.printStackTrace();
                }
            }
        }).start();
    }
    public static void main(String[] args) {
//        synchronized (ClassLoadClinit1.class){
//            System.out.println("static sync");
//            try {
//                Thread.sleep(100L);
//            } catch (Exception e){
//                e.printStackTrace();
//            }
//        }
        System.out.println("main");

    }
}
